package com.lifeng.disconf.callback;

/**
 * Created by lifeng on 2018/6/21.
 */

import com.baidu.disconf.client.common.annotations.DisconfUpdateService;
import com.baidu.disconf.client.common.update.IDisconfUpdate;
import com.lifeng.disconf.MySet;
import com.lifeng.disconf.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 更新配置时的回调函数
 */
@Service
@DisconfUpdateService(classes = {MySet.class})
public class DemoServiceUpdateCallBack implements IDisconfUpdate {
    @Autowired
    private DemoService demoService;

    @Override
    public void reload() throws Exception {
        demoService.changeCfg();
    }
}
